// 校验用户名
export const checkUsername = (username) => {
  return /^[a-zA-Z0-9_-]{4,10}$/.test(username);
};

// 校验密码
export const checkPassword = (password) => {
  return password.length >= 6 || password.length < 12;
};

// 校验邮箱
export const checkEmail = (email) => {
  return /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(
    email
  );
};

// 手机号
export const checkTel = (tel) => {
  return (
    /^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/.test(tel) ||
    /^(?:(?:\+|00)86)?1\d{10}$/.test(tel)
  );
};
